package com.li.link;

public class DoubleLinkesdemo1 {
    public static void main(String[] args) {
        System.out.println("双向链表测试");
        HereNode2 hereNode1 = new HereNode2(1, "宋江", "及时雨");
        HereNode2 hereNode2 = new HereNode2(2, "卢俊义", "玉麒麟");


        HereNode2 hereNode3 = new HereNode2(3, "吴用", "智多星");
        HereNode2 hereNode4 = new HereNode2(4, "林冲", "豹子头");
        DoubleLinst doubleLinst = new DoubleLinst();
        doubleLinst.add(hereNode1);
        doubleLinst.add(hereNode2);
        doubleLinst.add(hereNode3);
        doubleLinst.add(hereNode4);
        HereNode2 hereNode5 = new HereNode2(4, "公孙胜", "入云龙");
        doubleLinst.list();
        doubleLinst.update(hereNode5);
        System.out.println("----------");
        doubleLinst.list();
        doubleLinst.delete(4);
        System.out.println("删除");
        doubleLinst.list();
        System.out.println("----------");
        DoubleLinst doubleLinst2 = new DoubleLinst();
        doubleLinst2.addbyorder(hereNode1);
        doubleLinst2.addbyorder(hereNode3);
        doubleLinst2.addbyorder(hereNode2);
        doubleLinst2.addbyorder(hereNode4);
        doubleLinst2.list();


    }
}
